package com.egao.common.publicly.utils;

import cn.hutool.core.date.DateUtil;
import com.egao.common.core.web.PageParam;

import java.util.Date;

/**
 * 日期处理
 * @author pyx
 */
public class CalendarUtils {

    public static PageParam<?> putTime(PageParam<?> pageParam) {
        Date beginOfDay = null;
        Date endOfDay = null;

        if (pageParam.getPageData().get("holdTime") != null) {
            Date date = DateUtil.parse(pageParam.getPageData().get("holdTime").toString());
            beginOfDay = DateUtil.beginOfDay(date);
            endOfDay = DateUtil.endOfDay(date);
        }

        pageParam.put("beginOfDay",beginOfDay);
        pageParam.put("endOfDay",endOfDay);

        return pageParam;
    }
}
